package cn.zhage.aimin.satoken1;

import cn.dev33.satoken.config.SaTokenConfig;
import cn.zhage.aimin.satoken1.admin.AdminStpUtil;
import cn.zhage.aimin.satoken1.user.UserStpUtil;
import org.springframework.boot.autoconfigure.AutoConfiguration;

/*
 *
 * @author 渣哥
 */
public class StpUtilConfig {

    public void init(){
        SaTokenConfig adminConfig = new SaTokenConfig();
        adminConfig.setTokenName("aimin-admin-token");
        adminConfig.setTimeout(2592000);
        adminConfig.setActiveTimeout(-1L);
        adminConfig.setIsConcurrent(false);
        adminConfig.setIsShare(true);
        adminConfig.setIsLog(true);
        adminConfig.setTokenStyle("random-64");
        adminConfig.setIsWriteHeader(false);

        AdminStpUtil.stpLogic.setConfig(adminConfig);



        SaTokenConfig userConfig = new SaTokenConfig();
        userConfig.setTokenName("aimin-auth-token");
        userConfig.setTimeout(2592000);
        userConfig.setActiveTimeout(-1);
        userConfig.setIsConcurrent(false);
        userConfig.setIsShare(true);
        userConfig.setIsLog(true);
        userConfig.setTokenStyle("random-64");
        userConfig.setIsWriteHeader(false);

        UserStpUtil.stpLogic.setConfig(userConfig);
    }
}
